package com.zhentao.controller;

import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.social.dto.SocialDto;
import com.zhentao.model.social.pojo.ApUserCollect;
import com.zhentao.service.ApUserCollectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("api/v1/user/collect")
@Api(tags = "UserCollectController-关注管理")
public class UserCollectController {
    @Resource
    ApUserCollectService apUserCollectService;

    @PostMapping("/list/{userId}")
    @ApiOperation("根据关注人id查询被关注的人")
    public ResponseResult list(@PathVariable("userId") Integer userId){
        return apUserCollectService.getList(userId);
    }

    @PostMapping("/scoialList")
    @ApiOperation("关注De动态列表")
    public ResponseResult scoialList(@RequestBody SocialDto dto){
        return apUserCollectService.scoialList(dto.getUserId());
    }

    @PostMapping("/del")
    @ApiOperation("取消关注")
    public ResponseResult del(@RequestBody ApUserCollect apUserCollect){
        return apUserCollectService.delCollect(apUserCollect);
    }
    @PostMapping("/add")
    @ApiOperation("点击关注")
    public ResponseResult add(@RequestBody ApUserCollect apUserCollect){
        return apUserCollectService.add(apUserCollect);
    }
    @PostMapping("/likeMe")
    @ApiOperation("我的粉丝数")
    public ResponseResult likeMe(@RequestParam("userId") Integer userId){
        return apUserCollectService.likeMe(userId);
    }


    @PostMapping("/likeMeList")
    @ApiOperation("我的粉丝列表")
    public ResponseResult likeMeList(@RequestParam("userId") Integer userId){
        return apUserCollectService.likeMeList(userId);
    }

}
